package edu.etu.sob.model.impl;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import com.hp.hpl.jena.rdf.model.Resource;

import edu.etu.sob.model.IOntResourceDesc;
import edu.etu.sob.util.OntUtils;

@XmlRootElement(name="res_rest")
public class OntResourceDesc implements IOntResourceDesc {
	private String id;
	@XmlAttribute
	private String uri;
	@XmlAttribute
	private String shortName;
	@XmlAttribute
	private boolean isAnon;
	
	public OntResourceDesc() {
	}
	
	public OntResourceDesc(Resource prop) {
		this();
		
		String uri = prop.getURI();
		setUri(uri);
		setShortName(OntUtils.getShortName(prop, uri));
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public boolean isAnon() {
		return isAnon;
	}

	public void setAnon(boolean isAnon) {
		this.isAnon = isAnon;
	}

	public String getUri() {
		return uri;
	}

	protected void setUri(String uri) {
		this.uri = uri;
	}
	
	public String getShortName() {
		return shortName;
	}

	protected void setShortName(String sn) {
		shortName = sn;
	}

	@Override
	public int getType() {
		return 0;
	}
	
}
